// Reading characters using the read method of the System.in object
import java.io.IOException;
import java.util.Scanner;

public class ReadCharacters3 {
    public static void main(String[] args) throws IOException {
    	Scanner scanner = new Scanner(System.in);
    	char ch1, ch2;
        System.out.println("Enter a single character: ");
        ch1 = (char) System.in.read();
        scanner.nextLine();   // dummy read to remove \n or \r\n from the input buffer
        System.out.println("Enter another single character: ");
        ch2 = (char) System.in.read();
        System.out.println("It is " + (ch1 == ch2) + " that " + ch1 + " equals " + ch2 + ".");
    }
}
